global class batchClass implements Database.batchable<sObject>{ 
    global Database.QueryLocator start(Database.BatchableContext BC){
    String query='Select id , MZ_Album_ref__r.MZ_AuthorPerformer__c , MZ_Author_ref__c , MZ_YearTrack__c , MZ_Album_ref__r.MZ_Year__c , MZ_YearFormula__c From   MZ_Track__c  Where  MZ_Author_ref__c =NULL OR MZ_YearTrack__c=NULL OR MZ_YearFormula__c=FALSE';
      return Database.getQueryLocator(query);
   }  
   global void execute(Database.BatchableContext info, List<sObject> scope){
       for(MZ_Track__c track: (List<MZ_Track__c>) scope){ 
           if(track.MZ_Author_ref__c==NULL){
               track.MZ_Author_ref__c=track.MZ_Album_ref__r.MZ_AuthorPerformer__c;
           }if(track.MZ_YearTrack__c==NULL || track.MZ_YearFormula__c==FALSE){
           
          
               track.MZ_YearTrack__c=''+(INTEGER)track.MZ_Album_ref__r.MZ_Year__c;
             }
           
       
       } 
       //System.debug(scope+ 'abab');
       update scope; 
   }     
   global void finish(Database.BatchableContext info){     
   } 
}